const WXAPI = require('../../utils/api')

Page({
  data: {
    
  },
  onLoad(e) {
    // 读取分享链接中的邀请人编号
    if (e && e.inviter_id) {
      wx.setStorageSync('referrer', e.inviter_id)
    }
    this.setData({
      url: e.url
    })
  },
  onShareAppMessage(options) {
    console.log(options);
    // 用户点击右上角转发
    return {
      title: '"' + xhs.getStorageSync('comName') + '" ' + xhs.getStorageSync('share_profile'),
      path: '/pages/webview/website',
      query: 'inviter_id='+ xhs.getStorageSync('uid') +'&url='+ options.webViewUrl
    }
  },
  onShareTimeline(options) {
    // 用户点击右上角转发到朋友圈
    return {
      title: '"' + wx.getStorageSync('comName') + '" ' + wx.getStorageSync('share_profile'),
      path: '/pages/webview/website',
      query: 'inviter_id='+ xhs.getStorageSync('uid') +'&url='+ options.webViewUrl
    }
  },
  onShareChat(options) {
    // 用户点击右上角转发到微信群组
    return {
      title: '"' + wx.getStorageSync('comName') + '" ' + wx.getStorageSync('share_profile'),
      path: '/pages/webview/website',
      query: 'inviter_id='+ xhs.getStorageSync('uid') +'&url='+ options.webViewUrl
    }
  },
});
